package creational.singleton;

/**
 * @Description: 懒汉式（3）双重检查
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class Singleton5 {
    private static volatile Singleton5 instantce;

    private Singleton5() {

    }

    public static Singleton5 getInstantce() {
        if (instantce == null) {
            synchronized (Singleton5.class) {
                if (instantce == null) {
                    instantce = new Singleton5();
                }
            }
        }
        return instantce;
    }
}
